#include <iostream>
#include <cerrno>
#include <cstring>
#include <sys/types.h>
#include <signal.h>

using namespace std;

/*
    #include <sys/types.h>
    #include <signal.h>
    int kill(pid_t pid, int sig);
*/

void print_usage(string proc)
{
    cout << "\t【Usage】\n";
    cout << proc << " [sig_num] [pid]" << endl;
}

int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        print_usage(argv[0]);
        exit(1);
    }
    int signum = atoi(argv[1]);
    int pid = atoi(argv[2]);
    int n = kill(pid, signum);
    if (n != 0)
    {
        cerr << errno << " : " << strerror(errno) << endl;
        exit(2);
    }
    return 0;
}